import os
from yacs.config import CfgNode

cfg = CfgNode()
# cfg.root_dir = r'D:\Data\Project\PythonProject\MemeCLIP-main\MemeCLIP-main'
# cfg.img_folder = r'D:\Data\Dataset\PrideMM\PrideMM\Images'
# cfg.info_file = r'D:\Data\Dataset\PrideMM\PrideMM\PrideMM.csv'

cfg.root_dir = r'D:\Data\Project\PythonProject\MemeCLIP-main\MemeCLIP-main\chexpert'
cfg.img_folder = r'D:\Data\Dataset'
cfg.info_file = r'D:\Data\Project\PythonProject\chexpert\mindataset\output\dataset_split.csv'
cfg.checkpoint_path = os.path.join(cfg.root_dir, 'checkpoints')
cfg.checkpoint_file = os.path.join(cfg.checkpoint_path,'model.ckpt')

#cfg.clip_variant = "ViT-L/14"
cfg.clip_variant = "ViT-B/32"
cfg.dataset_name = 'Pride'
cfg.name = 'MemeCLIP'
cfg.label = 'hate'
cfg.seed = 42
cfg.test_only = False
cfg.device = 'cuda'
cfg.gpus = [0]
cfg.class_names = [
    'No Finding', 'Enlarged Cardiomediastinum', 'Cardiomegaly', 'Lung Opacity',
    'Lung Lesion', 'Edema', 'Consolidation', 'Pneumonia', 'Atelectasis',
    'Pneumothorax', 'Pleural Effusion', 'Pleural Other', 'Fracture'
]
cfg.num_classes = len(cfg.class_names)
cfg.multi_label = True   # 可选，给下游流程一个标记
# cfg.label 可以不用

# # cfg.label 可以留空或删除
# if cfg.label =='hate':
#     cfg.class_names = ['Benign Meme', 'Harmful Meme']
# elif cfg.label == 'humour':
#     cfg.class_names = ['No Humour', 'Humour']
# elif cfg.label == 'target':
#     cfg.class_names = ['No particular target', 'Individual', 'Community', 'Organization']
# elif cfg.label == 'stance':
#     cfg.class_names = ['Neutral', 'Support', 'Oppose']

cfg.batch_size = 8
cfg.image_size = 224
cfg.num_mapping_layers = 1

# cfg.unmapped_dim = 768
# cfg.map_dim = 1024
cfg.unmapped_dim = 512
cfg.map_dim = 768
cfg.num_pre_output_layers = 1
cfg.drop_probs = [0.1, 0.4, 0.2]

#cfg.lr = 1e-4
cfg.lr = 5e-5
cfg.max_epochs = 15
cfg.ratio = 0.2
cfg.weight_decay = 1e-4
cfg.num_classes = len(cfg.class_names)

# cfg.scale = 30
cfg.scale = 20
cfg.print_model = True
# -------------------------------------------
# Global configuration (YACS)
# -------------------------------------------


